#ifndef OGLMANAGER_H
#define OGLMANAGER_H

#include <QOpenGLFunctions_3_3_Core>
#include "light.h"
#include "camera.h"
#include "model.h"

class OGLManager
{
public:
    OGLManager(GLuint w, GLuint h);
    ~OGLManager();

    GLboolean init();
    void resize(GLuint w, GLuint h);
    void processInput(GLfloat deltaTime);
    void update(GLfloat deltaTime);
    void draw(GLfloat deltaTime);
    GLboolean loadModel(const QString &file);

public:
    Camera *camera;
    GLboolean keys[1024];

private:
    QOpenGLFunctions_3_3_Core *core;
    GLuint width;
    GLuint height;

    Light *light;

    Model *object;
    GLfloat modelScaling;// obj模型缩放比例
    GLboolean isOpenLighting;
    GLboolean isLineMode;
};

#endif // OGLMANAGER_H
